﻿<%@ Page Title="" Language="C#" MasterPageFile="~/OrderManagement.master" AutoEventWireup="true"
    CodeBehind="CompleteOrder.aspx.cs" Inherits="SCFHS.Views.CompleteOrder" %>

<asp:Content ID="Content1" ContentPlaceHolderID="NastedHead" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#CompleteOrder").addClass("createOrderMenuactive");
            $(".textTool").mousemove(function () {
                $(".textTool").css('cursor', 'pointer');
            });
        });

        function pageLoad(sender, args) {
            $(".colorSelector").ColorPicker({
                color: '#ffffff',
                onShow: function (colpkr) {
                    if (toggleSelection(this, "color", "")) {
                        $(colpkr).fadeIn(500);
                    }
                    return false;
                },
                onHide: function (colpkr) {
                    ReplaceWithColor("as");
                    $(colpkr).fadeOut(500);
                    return false;
                },
                onChange: function (hsb, hex, rgb) {
                    if (GetEditingArea()) {
                        $(GetEditingArea()).parentsUntil(".AppandItem").parent().find(".colorizer").css('background-color', '#' + hex);
                        $(GetEditingArea()).parentsUntil(".AppandItem").parent().find(".colorSelector div").css('background-color', '#' + hex);
                        $(GetEditingArea()).parentsUntil(".AppandItem").parent().find(".colorSelector input:hidden").val(hex);
                    }
                }
            });
        }

        function OpenFile(ths) {
            var Filename = '<%= ResolveUrl(ConfigurationManager.AppSettings["UploadPath"].ToString()) %>';
            if (document.all) {
                Filename = Filename + '/' + ths.innerText;
            } else {
                Filename = Filename + '/' + ths.textContent;
            }
            window.open(Filename, '_blank');
            return false;
        }

        function SetEditingArea(ths) {
            var textArea = $(ths).parentsUntil(".AppandItem").parent().find("textarea").get(0);
            $("#EditingArea").val(textArea.id);
        }

        function GetEditingArea() {
            if ($("#EditingArea").val() == "")
                return false;
            return $("#" + $("#EditingArea").val()).get(0);
        }

        function checkClassification() {
            __doPostBack("<%=loadClassi.ClientID %>", "");
        }
        function checkByID() {
            __doPostBack("<%=loadById.ClientID %>", "");
        }
        function GetParentTextArea(ths) {
            var toplayer = $(ths).parents().find(".AppandItem textarea").get(0);
            if (toplayer == undefined) {
                alert("يجب إختيار نص اولا");
                return false;
            }
            return toplayer;
        }

        function ReplaceWithColor() {
            if ($("#EditingArea").val() == "")
                return false;

            var textArea = $("#" + $("#EditingArea").val()).get(0);

            if (textArea == undefined)
                return false;

            var val = $(textArea).parentsUntil(".AppandItem").parent().find(".colorizer").get(0);

            if (textArea.innerText) {
                val = val.style.backgroundColor;
                if (textArea.innerText != "")
                    textArea.innerText = textArea.innerText.replace("#%*", val);
            }
            else {
                if (textArea.value == "")
                    return false;
                var txtAreaContent = textArea.value;
                val = $(val).parent().find("input:hidden").val();
                txtAreaContent = txtAreaContent.replace("#%*", "#" + val);
                textArea.value = txtAreaContent;
            }
        }

        function toggleSelection(ths, action, value) {
            var textarea = GetParentTextArea(ths);
            var StartKey = "";
            var EndKey = "";
            if (!textarea)
                return;
            switch (action) {
                case "bold":
                    StartKey = "[b]";
                    EndKey = "[/b]";
                    break;
                case "color":
                    if (value == "") {
                        StartKey = "[font color='#%*'c]";
                        EndKey = "[/font]";
                    } else {
                        ReplaceWithColor(textarea, value);
                    }
                    break;
                default:
                    break;
            }

            if (StartKey == "" && EndKey == "")
                return true;

            var selection = "";
            if ('selectionStart' in textarea) {
                // check whether some text is selected in the textarea
                if (textarea.selectionStart != textarea.selectionEnd) {
                    selection = textarea.value.substring(textarea.selectionStart, textarea.selectionEnd);
                    if (selection == "") {
                        alert("يجب إختيار نص اولا");
                        return false;
                    }
                    var newText = textarea.value.substring(0, textarea.selectionStart) +
                        StartKey + textarea.value.substring(textarea.selectionStart, textarea.selectionEnd) + EndKey +
                        textarea.value.substring(textarea.selectionEnd);
                    textarea.value = newText;
                }
            }
            else {	// Internet Explorer before version 9
                // create a range from the current selection
                var textRange = document.selection.createRange();
                selection = textRange.text;
                if (selection == "") {
                    alert("يجب إختيار نص اولا");
                    return false;
                }
                textRange.text = StartKey + selection + EndKey;
            }
            return true;
        }
        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NastedBody" runat="server">
    <asp:HiddenField ID="hdfOrderNo" runat="server" />
    <input type="hidden" id="EditingArea" value=" " />
    <div>
        <asp:Label Text=" " runat="server" ID="lblMessage" class="info" />
    </div>
    <asp:MultiView ActiveViewIndex="0" runat="server" ID="mView">
        <asp:View runat="server" ID="GetOrder">
            <div class="tooltip">
                <asp:Label Text="أدخل رقم الطلب للإستمرار في عملية إستكمال بيانات الطلب" runat="server"></asp:Label>
            </div>
            <div id="SelectOrder">
                <div class="row OrderInfo">
                    <ul class="title">
                        <li>رقم الطلب</li>
                    </ul>
                    <ul class="data">
                        <li>
                            <asp:TextBox runat="server" ID="txtOrderNumberToSearch" Font-Size="18" ValidationGroup="Search"
                                CssClass="ltrNumbers" /><asp:RequiredFieldValidator ErrorMessage="يجب إدخال رقم الطلب أولا"
                                    ControlToValidate="txtOrderNumberToSearch" ValidationGroup="Search" runat="server"
                                    Text="*" ForeColor="Red" /></li>
                    </ul>
                    <ul class="data">
                        <li>
                            <asp:Button Text="إستكمال الطلب" runat="server" ID="btnNextToOrder" Font-Size="16"
                                OnClick="btnNextToOrder_Click" CssClass="button" ValidationGroup="Search" /></li>
                    </ul>
                </div>
            </div>
        </asp:View>
        <asp:View runat="server" ID="OrderDetails">
            <div id="MainInfo" class="Box radius">
                <div class="BoxTitle radius">
                    البيانات الأساسية
                </div>
                <div class="subContent">
                    <div class="row">
                        <ul class="title">
                            <li>الإسم</li>
                        </ul>
                        <ul class="data">
                            <li>
                                <asp:TextBox ID="txtpersonName" runat="server" Width="265px" Font-Size="20px" TabIndex="1"
                                    disabled="disabled" MaxLength="80" /><asp:RequiredFieldValidator ID="RequiredFieldValidator1"
                                        ErrorMessage="يجب إدخال إسم صاحب الطلب اولا" ControlToValidate="txtPersonName"
                                        runat="server" Text="*" ForeColor="Red" ValidationGroup="OrderMainDetails" /></li>
                        </ul>
                        <ul class="title">
                            <li>الرقم</li>
                        </ul>
                        <ul class="data">
                            <li>
                                <asp:TextBox ID="txtOrderNumber" runat="server" Width="100px" TabIndex="1" disabled="disabled"
                                    CssClass="ltrNumbers" MaxLength="20" /><asp:RequiredFieldValidator ID="RequiredFieldValidator5"
                                        ErrorMessage="يجب إدخال رقم الطلب" ControlToValidate="txtOrderNumber" runat="server"
                                        Text="*" ForeColor="Red" ValidationGroup="OrderMainDetails" /></li>
                        </ul>
                        <ul class="title">
                            <li>التاريخ</li>
                        </ul>
                        <ul class="data">
                            <li>
                                <asp:TextBox ID="txtDate" runat="server" Width="100px" TabIndex="2" disabled="disabled" /></li>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="ProgressContent update">
                <a href="#" class="openControls" style="margin: 10px 10px;">تعديل البيانات</a><asp:Button
                    Text="تحديث الطلب" runat="server" Font-Size="16" ID="btnUpdateOrder" OnClick="btnUpdateOrder_Click"
                    Visible="true" disabled="true" ValidationGroup="OrderMainDetails" CssClass="button" />
                <script type="text/javascript">
                    $(".openControls").click(function () {
                        $("#MainInfo input").attr("disabled", false);
                        $("#<%= btnUpdateOrder.ClientID%>").attr("disabled", false);
                    });
                </script>
            </div>
            <div class="OrderFullInfo Box radius">
                <div class="BoxTitle radius">
                    بيانات الطلب
                </div>
                <div class="row" style="padding: 10px 30px;">
                    <div class="row" style="white-space: nowrap;">
                        <div class="col">
                            <ul class="title">
                                <li class="Alter">الموضوع</li>
                                <li>الجنسية</li>
                                <li class="Alter">بلد الإقامة <span>(الحالي)</span></li>
                                <li class="heightRow">الهوية</li>
                                <li>&nbsp;</li>
                            </ul>
                            <ul class="data" style="width: 260px;">
                                <li class="Alter">
                                    <asp:TextBox ID="txtSubject" runat="server" ValidationGroup="UpdateFull" MaxLength="100" /></li>
                                <li>
                                    <asp:DropDownList ID="drpNationality" runat="server" Width="150" OnDataBound="drp_DataBound"
                                        ValidationGroup="UpdateFull">
                                    </asp:DropDownList>
                                    <asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="*" ForeColor="Red"
                                        ControlToValidate="drpNationality" MinimumValue="1" MaximumValue="999999" ValidationGroup="UpdateFull"></asp:RangeValidator>
                                </li>
                                <li class="Alter">
                                    <asp:DropDownList ID="drpCurrenCity" runat="server" Width="150" OnDataBound="drp_DataBound"
                                        ValidationGroup="UpdateFull">
                                    </asp:DropDownList>
                                    <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="*" ForeColor="Red"
                                        ControlToValidate="drpCurrenCity" MinimumValue="1" MaximumValue="999999" ValidationGroup="UpdateFull"></asp:RangeValidator>
                                </li>
                                <li class="heightRow">
                                    <div class="subLi">
                                        <asp:TextBox ID="txtIDNumber" runat="server" ValidationGroup="UpdateFull" MaxLength="10"
                                            CssClass="ltrNumbers" onblur="checkByID()" /></div>
                                    <div class="hradio">
                                        <asp:RadioButtonList ID="rdIDType" runat="server" RepeatDirection="Vertical" ValidationGroup="UpdateFull">
                                            <asp:ListItem Text="بطاقة/إقامة" Value="0" Selected="True" />
                                            <asp:ListItem Text="جواز سفر" Value="1" />
                                        </asp:RadioButtonList>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        <div class="col">
                            <ul class="title" style="width: 140px;">
                                <li class="Alter">رقم التصنيف</li>
                                <li>مكان الميلاد</li>
                                <li class="Alter">مكان الحصول على الثانوية</li>
                                <li class="heightRow">جهة العمل</li>
                                <li>&nbsp;</li>
                            </ul>
                            <ul class="data" style="width: 220px;">
                                <li class="Alter">
                                    <asp:TextBox ID="txtClass" runat="server" ValidationGroup="UpdateFull" MaxLength="20"
                                        CssClass="ltrNumbers" onblur="checkClassification()" /></li>
                                <li>
                                    <asp:RadioButtonList ID="rdBirthPlace" runat="server" RepeatDirection="Horizontal"
                                        ValidationGroup="UpdateFull">
                                        <asp:ListItem Text="داخل السعودية" Value="0" Selected="True" />
                                        <asp:ListItem Text="خارج السعودية" Value="1" />
                                    </asp:RadioButtonList>
                                </li>
                                <li class="Alter">
                                    <asp:RadioButtonList ID="rdSecondrySchool" runat="server" RepeatDirection="Horizontal"
                                        ValidationGroup="UpdateFull">
                                        <asp:ListItem Text="داخل السعودية" Value="0" Selected="True" />
                                        <asp:ListItem Text="خارج السعودية" Value="1" />
                                    </asp:RadioButtonList>
                                </li>
                                <li class="heightRow">
                                    <div class="subLi">
                                        <asp:TextBox ID="txtWorkPlace" runat="server" ValidationGroup="UpdateFull" MaxLength="80" />
                                    </div>
                                    <div class="hradio">
                                        <asp:RadioButtonList ID="rdWorkType" runat="server" RepeatDirection="Vertical" ValidationGroup="UpdateFull">
                                            <asp:ListItem Text="حكومي" Value="0" Selected="True" />
                                            <asp:ListItem Text="أهلي" Value="1" />
                                        </asp:RadioButtonList>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="row">
                        <asp:UpdatePanel runat="server" ID="upnlLoadClassi" OnLoad="upnlLoadClassi_Load">
                            <ContentTemplate>
                                <asp:LinkButton Text=" " runat="server" ID="loadClassi" Style="display: none;" />
                                <asp:LinkButton Text=" " runat="server" ID="loadById" Style="display: none;" />
                                <asp:GridView runat="server" ID="grdOrderByClassification" AutoGenerateColumns="False"
                                    CellPadding="4" ForeColor="#333333" GridLines="Both" BorderWidth="2" DataKeyNames="ID"
                                    Visible="false">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="م">
                                            <ItemTemplate>
                                                <div style="width: 19px; text-align: center">
                                                    <%#Container.DataItemIndex+1 %>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="رقم الطلب" ItemStyle-Width="100">
                                            <ItemTemplate>
                                                <%# Eval("OrderNumber")%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="صاحب الطلب" ItemStyle-Width="200">
                                            <ItemTemplate>
                                                <%# Eval("PersonName")%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="رقم التصنيف" ItemStyle-Width="120">
                                            <ItemTemplate>
                                                <%# Eval("OrderClassificationNumber")%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="تاريخ الطلب" ItemStyle-Width="100">
                                            <ItemTemplate>
                                                <%# String.Format("{0:dd/MM/yyyy}", Eval("OrderCreatedOn"))%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="حالة الطلب" ItemStyle-Width="100">
                                            <ItemTemplate>
                                                <%#parseOrderStateAr(Eval("OrderState").ToString())%>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-Width="78" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                                <asp:LinkButton Text="التفاصيل" runat="server" CommandArgument=' <%# Eval("ID")%>'
                                                    OnClick="btnDetails_Click" ID="btnDetails" />
                                            </ItemTemplate>
                                            <ItemStyle HorizontalAlign="Center" Width="78px"></ItemStyle>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <EmptyDataTemplate>
                                        <asp:Label ID="Label1" Text=" لا توجد نتائج" runat="server" Width="500px" />
                                    </EmptyDataTemplate>
                                    <EmptyDataRowStyle ForeColor="White" Font-Bold="true" BorderStyle="None" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
            </div>
            <div class="ProgressContent update">
                <asp:Button Text="حفظ بيانات الطلب" runat="server" ID="btnUpdateFullOrder" Font-Size="16"
                    OnClick="btnUpdateFullOrder_Click" ValidationGroup="UpdateFull" CssClass="button" />
            </div>
            <div id="OrderAttachmentFiles" class="Box radius-Bottom">
                <div class="ContentTitle">
                    ◄ المرفقات
                </div>
                <div class="row AttachContent">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" RenderMode="Inline">
                        <ContentTemplate>
                            <asp:UpdateProgress ID="UpdateProgress4" runat="server" AssociatedUpdatePanelID="UpdatePanel1"
                                DisplayAfter="1">
                                <ProgressTemplate>
                                    <div style="position: absolute; z-index: 100; background-color: Gray; color: White;">
                                        جاري تنفيذ العملية يرجي الإنتظار قليلاً ....
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div class="row">
                                <asp:Label Text=" " runat="server" ID="lblUploadMessage" class="info" />
                            </div>
                            <div id="AttachItem" class="row">
                                <div style="float: right;">
                                    <asp:FileUpload runat="server" ID="fuAttach" Width="341" Height="30" EnableViewState="false" /><asp:RequiredFieldValidator
                                        ID="RequiredFieldValidator6" ErrorMessage="يجب تحديد ملف اولا" ControlToValidate="fuAttach"
                                        runat="server" Text="*" ForeColor="Red" ValidationGroup="upload" />
                                </div>
                                <div>
                                    <asp:Button Text="رفع" runat="server" ID="btnUpload" OnClick="btnUpload_Click" Width="80"
                                        CssClass="button" ValidationGroup="upload" />
                                </div>
                            </div>
                            <div class="row">
                                <asp:GridView runat="server" ID="grdAttachmentFiles" AutoGenerateColumns="False"
                                    CellPadding="4" ForeColor="#333333" GridLines="Both" BorderWidth="2" DataKeyNames="ID"
                                    OnRowDeleting="grdAttachmentFiles_RowDeleting" OnRowDataBound="grdAttachmentFiles_RowDataBound">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="م">
                                            <ItemTemplate>
                                                <div style="width: 19px; text-align: center">
                                                    <%#Container.DataItemIndex+1 %>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="الملــفات">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lblAttachmentPoint" Text='<%# Eval("AttachmentPath")%>' runat="server"
                                                    Width="300" OnClientClick="return OpenFile(this)"></asp:LinkButton>
                                            </ItemTemplate>
                                            <ItemStyle Width="450px" HorizontalAlign="Right" />
                                        </asp:TemplateField>
                                        <asp:CommandField ShowDeleteButton="true" DeleteText="حذف" ControlStyle-Width="80">
                                            <ControlStyle Width="80px" />
                                        </asp:CommandField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <EmptyDataTemplate>
                                        <asp:Label ID="Label1" Text=" لم يتم رفع مرفقات للطلب" runat="server" Width="500px" />
                                    </EmptyDataTemplate>
                                    <EmptyDataRowStyle ForeColor="Black" Font-Bold="true" BorderStyle="None" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#056796" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div id="OrderSummery" class="Box  radius-Bottom">
                <div class="ContentTitle">
                    ◄ عرض و تلخيص الطلب
                </div>
                <div class="BoxContent">
                    <asp:UpdatePanel ID="upnlSummery" runat="server" class="SummeryContent" UpdateMode="Always">
                        <ContentTemplate>
                            <asp:Label Text=" " runat="server" ID="lblMessageSummery" CssClass="info" />
                            <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="upnlSummery">
                                <ProgressTemplate>
                                    <div style="position: absolute; z-index: 100; background-color: Gray; color: White;">
                                        جاري تنفيذ العملية يرجي الإنتظار قليلاً ....
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div class="row AppandItem">
                                <div class="row textTools">
                                    <div class="colorSelector">
                                        <div style="background-color: #0000ff">
                                            <input type="button" style="border: none; width: 22px; height: 17px; background-color: #0000ff;
                                                margin: 4px 4px; cursor: default;" onclick="SetEditingArea(this)" class="colorizer" />
                                            <input type="hidden" id="hexVal" value="" />
                                        </div>
                                    </div>
                                    <div class="Bold" style="margin-right: 2px;">
                                        <input type="button" class="btnbold textTool radius" value="B" onclick="toggleSelection(this,'bold', '');" />
                                    </div>
                                </div>
                                <div class="row">
                                    <asp:TextBox runat="server" TextMode="MultiLine" ID="txtSummeryItem" Width="400"
                                        ValidationGroup="addSummeryItem" Height="40" Style="overflow: hidden;" MaxLength="500" /><asp:RequiredFieldValidator
                                            ErrorMessage="يجب إضافة نص العنصر اولا" ControlToValidate="txtSummeryItem" runat="server"
                                            Text="*" ValidationGroup="addSummeryItem" ForeColor="Red" />
                                </div>
                                <div>
                                    <asp:Button Text="إضافة" runat="server" ID="btnAddSummeryItem" OnClick="btnAddSummeryItem_Click"
                                        ValidationGroup="addSummeryItem" Font-Size="16" Width="80" Height="45" CssClass="button" />
                                </div>
                            </div>
                            <div class="row" style="padding-top: 5px; max-height: 200px; overflow: auto; width: 515px;">
                                <asp:GridView runat="server" ID="grdSummery" AutoGenerateColumns="False" CellPadding="4"
                                    ForeColor="#333333" GridLines="Both" BorderWidth="2" OnRowCancelingEdit="grdSummery_RowCancelingEdit"
                                    OnRowEditing="grdSummery_RowEditing" OnRowDeleting="grdSummery_RowDeleting" OnRowUpdating="grdSummery_RowUpdating"
                                    DataKeyNames="ID">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="م">
                                            <ItemTemplate>
                                                <div style="width: 19px; text-align: center">
                                                    <%#Container.DataItemIndex+1 %>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="النقاط">
                                            <ItemTemplate>
                                                <div style="width: 368px;">
                                                    <%# Eval("Point") %>
                                                </div>
                                            </ItemTemplate>
                                            <ItemStyle Width="368px" HorizontalAlign="Right" />
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtSummeryPoint" Text='<%# Eval("Point")%>' runat="server" Width="300"
                                                    ValidationGroup="Update" MaxLength="500"></asp:TextBox><asp:RequiredFieldValidator
                                                        ID="RequiredFieldValidator4" ErrorMessage="*" ControlToValidate="txtSummeryPoint"
                                                        runat="server" ValidationGroup="Update" ForeColor="Red" />
                                            </EditItemTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ButtonType="Link" CancelImageUrl="" CancelText="إلغاء" ShowCancelButton="true"
                                            EditImageUrl="" EditText="تعديل" ShowEditButton="true" DeleteImageUrl="" DeleteText="حذف"
                                            ShowDeleteButton="true" UpdateImageUrl="" UpdateText="تحديث" ItemStyle-Width="78"
                                            ItemStyle-HorizontalAlign="Center" ValidationGroup="Update" />
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <EmptyDataTemplate>
                                        <asp:Label ID="Label1" Text=" قم بالكتابة في المكان المخصص لإضافة عنصر جديد" runat="server"
                                            Width="500px" />
                                    </EmptyDataTemplate>
                                    <EmptyDataRowStyle ForeColor="White" Font-Bold="true" BorderStyle="None" BackColor="Transparent" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#056796" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div id="OrderRequest" class="Box  radius-Bottom">
                <div class="ContentTitle">
                    ◄ يرغب صاحب الطلب
                </div>
                <div class=" BoxContent">
                    <asp:UpdatePanel ID="upnlRequests" runat="server" class="SummeryContent">
                        <ContentTemplate>
                            <div>
                                <asp:Label Text=" " runat="server" ID="lblMessageRequests" CssClass="info" />
                            </div>
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="upnlRequests">
                                <ProgressTemplate>
                                    <div style="position: absolute; z-index: 100; background-color: Gray; color: White;">
                                        جاري تنفيذ العملية يرجي الإنتظار قليلاً ....
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div class="row AppandItem">
                                <div class="row textTools">
                                    <div class="colorSelector">
                                        <div style="background-color: #0000ff">
                                            <input type="button" style="border: none; width: 22px; height: 17px; background-color: #0000ff;
                                                margin: 4px 4px; cursor: default;" onclick="SetEditingArea(this)" class="colorizer" />
                                            <input type="hidden" id="Hidden1" value="" />
                                        </div>
                                    </div>
                                    <div class="Bold" style="margin-right: 2px;">
                                        <input type="button" class="btnbold textTool radius" value="B" onclick="toggleSelection(this,'bold', '');" />
                                    </div>
                                </div>
                                <div class="row">
                                    <asp:TextBox runat="server" TextMode="MultiLine" ID="txtRequestItem" Width="400"
                                        ValidationGroup="addRequestItem" Height="40" Style="overflow: hidden;" /><asp:RequiredFieldValidator
                                            ID="RequiredFieldValidator2" ErrorMessage="يجب إضافة نص العنصر اولا" ControlToValidate="txtRequestItem"
                                            runat="server" Text="*" ValidationGroup="addRequestItem" ForeColor="Red" />
                                </div>
                                <div>
                                    <asp:Button Text="إضافة" runat="server" ID="btnAddRequestItem" ValidationGroup="addRequestItem"
                                        OnClick="btnAddRequestItem_Click" Font-Size="16" Width="80" Height="45" CssClass="button" />
                                </div>
                            </div>
                            <div class="row" style="padding-top: 5px; max-height: 200px; overflow: auto; width: 515px;">
                                <asp:GridView runat="server" ID="grdRequest" AutoGenerateColumns="False" CellPadding="4"
                                    ForeColor="#333333" GridLines="Both" BorderWidth="2" OnRowCancelingEdit="grdRequest_RowCancelingEdit"
                                    OnRowEditing="grdRequest_RowEditing" OnRowDeleting="grdRequest_RowDeleting" OnRowUpdating="grdRequest_RowUpdating"
                                    DataKeyNames="ID">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="م">
                                            <ItemTemplate>
                                                <div style="width: 19px; text-align: center">
                                                    <%# Container.DataItemIndex+1 %>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="النقاط">
                                            <ItemTemplate>
                                                <div style="width: 368px;">
                                                    <%# Eval("Point") %>
                                                </div>
                                            </ItemTemplate>
                                            <ItemStyle Width="368px" HorizontalAlign="Right" />
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtRequestPoint" Text='<%# Eval("Point")%>' runat="server" Width="300"
                                                    ValidationGroup="Update" MaxLength="500"></asp:TextBox><asp:RequiredFieldValidator
                                                        ID="RequiredFieldValidator4" ErrorMessage="*" ControlToValidate="txtRequestPoint"
                                                        runat="server" ValidationGroup="Update" ForeColor="Red" />
                                            </EditItemTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ButtonType="Link" CancelImageUrl="" CancelText="إلغاء" ShowCancelButton="true"
                                            EditImageUrl="" EditText="تعديل" ShowEditButton="true" DeleteImageUrl="" DeleteText="حذف"
                                            ShowDeleteButton="true" UpdateImageUrl="" UpdateText="تحديث" ItemStyle-Width="78"
                                            ItemStyle-HorizontalAlign="Center" ValidationGroup="Update" />
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <EmptyDataTemplate>
                                        <asp:Label ID="Label1" Text=" قم بالكتابة في المكان المخصص لإضافة عنصر جديد" runat="server"
                                            Width="500px" />
                                    </EmptyDataTemplate>
                                    <EmptyDataRowStyle ForeColor="White" Font-Bold="true" BorderStyle="None" BackColor="Transparent" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#056796" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div id="OrderAttachmens" class="Box radius-Bottom">
                <div class="ContentTitle">
                    ◄ وصف المرفقات
                </div>
                <div id="AttachContent" class=" BoxContent row" style="padding-right: 2px;">
                    <asp:UpdatePanel ID="upnlAttachments" runat="server" class="SummeryContent">
                        <ContentTemplate>
                            <div>
                                <asp:Label Text=" " runat="server" ID="lblMessageAttachments" CssClass="info" />
                            </div>
                            <asp:UpdateProgress ID="UpdateProgress3" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="upnlAttachments">
                                <ProgressTemplate>
                                    <div style="position: absolute; z-index: 100; background-color: Gray; color: White;">
                                        جاري تنفيذ العملية يرجي الإنتظار قليلاً ....
                                    </div>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div class="row AppandItem">
                                <div class="row textTools">
                                    <div class="colorSelector">
                                        <div style="background-color: #0000ff">
                                            <input type="button" style="border: none; width: 22px; height: 17px; background-color: #0000ff;
                                                margin: 4px 4px; cursor: default;" onclick="SetEditingArea(this)" class="colorizer" />
                                            <input type="hidden" id="Hidden2" value="" />
                                        </div>
                                    </div>
                                    <div class="Bold" style="margin-right: 2px;">
                                        <input type="button" class="btnbold textTool radius" value="B" onclick="toggleSelection(this,'bold', '');" />
                                    </div>
                                </div>
                                <div class="row">
                                    <asp:TextBox runat="server" TextMode="MultiLine" ID="txtAttachmentItem" Width="400"
                                        ValidationGroup="addAttachmentItem" Height="40" Style="overflow: hidden;" /><asp:RequiredFieldValidator
                                            ID="RequiredFieldValidator3" ErrorMessage="يجب إضافة نص العنصر اولا" ControlToValidate="txtAttachmentItem"
                                            runat="server" Text="*" ValidationGroup="addAttachmentItem" ForeColor="Red" />
                                </div>
                                <div>
                                    <asp:Button Text="إضافة" runat="server" ID="btnAddAttachmentItem" OnClick="btnAddAttachmentItem_Click"
                                        ValidationGroup="addAttachmentItem" Font-Size="16" Width="80" Height="45" CssClass="button" />
                                </div>
                            </div>
                            <div class="row" style="padding-top: 5px; max-height: 200px; overflow: auto; width: 515px;">
                                <asp:GridView runat="server" ID="grdAttachments" AutoGenerateColumns="False" CellPadding="4"
                                    ForeColor="#333333" GridLines="Both" BorderWidth="2" OnRowCancelingEdit="grdAttachments_RowCancelingEdit"
                                    OnRowEditing="grdAttachments_RowEditing" OnRowDeleting="grdAttachments_RowDeleting"
                                    OnRowUpdating="grdAttachments_RowUpdating" DataKeyNames="ID">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="م">
                                            <ItemTemplate>
                                                <div style="width: 19px; text-align: center">
                                                    <%# Container.DataItemIndex+1 %>
                                                </div>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="النقاط">
                                            <ItemTemplate>
                                                <%# Eval("Point") %>
                                            </ItemTemplate>
                                            <ItemStyle Width="368px" HorizontalAlign="Right" />
                                            <EditItemTemplate>
                                                <asp:TextBox ID="txtAttachmentPoint" Text='<%# Eval("Point")%>' runat="server" Width="300"
                                                    ValidationGroup="Update" MaxLength="500"></asp:TextBox><asp:RequiredFieldValidator
                                                        ID="RequiredFieldValidator4" ErrorMessage="*" ControlToValidate="txtAttachmentPoint"
                                                        runat="server" ValidationGroup="Update" ForeColor="Red" />
                                            </EditItemTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ButtonType="Link" CancelImageUrl="" CancelText="إلغاء" ShowCancelButton="true"
                                            EditImageUrl="" EditText="تعديل" ShowEditButton="true" DeleteImageUrl="" DeleteText="حذف"
                                            ShowDeleteButton="true" UpdateImageUrl="" UpdateText="تحديث" ItemStyle-Width="78"
                                            ItemStyle-HorizontalAlign="Center" ValidationGroup="Update" />
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <EmptyDataTemplate>
                                        <asp:Label ID="Label1" Text="عفوا لا توجد مرفقات للطلب" runat="server" Width="500px" />
                                    </EmptyDataTemplate>
                                    <EmptyDataRowStyle ForeColor="White" Font-Bold="true" BorderStyle="None" BackColor="Transparent" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#056796" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
            </div>
            <div class="ProgressContent update">
                <asp:Button Text="تجهيز الطلب للطباعة" runat="server" ID="btnUpdateOrderState" Font-Size="16"
                    OnClick="btnUpdateOrderState_Click" CssClass="button" />
            </div>
        </asp:View>
    </asp:MultiView>
</asp:Content>
